import type { GetMaterialBalanceInput, LoadSupplyDemandDataInput, MaterialBalanceAnalysisDto } from './models';
import { RestService } from '@abp/ng.core';
import type { PagedResultDto } from '@abp/ng.core';
import { Injectable } from '@angular/core';

@Injectable({
  providedIn: 'root',
})
export class MaterialManagementPlatformService {
  apiName = 'BasicArchives';
  

  clearCache = () =>
    this.restService.request<any, void>({
      method: 'DELETE',
      url: '/api/basic-archives/material-management-platform/clear-cache',
    },
    { apiName: this.apiName });
  

  getMaterialBalanceAnalysis = (input: GetMaterialBalanceInput) =>
    this.restService.request<any, PagedResultDto<MaterialBalanceAnalysisDto>>({
      method: 'POST',
      url: '/api/basic-archives/material-management-platform/material-balance-analysis',
      body: input,
    },
    { apiName: this.apiName });
  

  loadSupplyDemandData = (input: LoadSupplyDemandDataInput) =>
    this.restService.request<any, boolean>({
      method: 'POST',
      url: '/api/basic-archives/material-management-platform/load-supply-demand-data',
      body: input,
    },
    { apiName: this.apiName });

  constructor(private restService: RestService) {}
}
